(()=>{"use strict";const e="wpcp-d-hidden",t=new WeakMap;function n(e){return!(!e||"object"!=typeof e)&&(!0===e.isTiles||("tiles"===e.slug||"grid"===(e.style||"standard")))}function i(e,t){const n=parseInt(e,10);return isNaN(n)?t:n}const o=function(e){if("string"!=typeof e||""===e)return null;const t=e.indexOf("/"),n=-1===t?e:e.slice(0,t),i=parseInt(n,10);return!Number.isFinite(i)||i<1?null:i-1};function r(e,t,n){const i=Math.max(1,n);if(1===i)return e.map(function(){return{colSpan:1,rowSpan:1}});const o=Math.max(1,t),r=i/o;return e.map(function(e){const t=Math.round(e.colSpan),n=Math.round(e.rowSpan),o=Math.max(1,t>0?t:1),a=Math.max(1,n>0?n:1),c=Math.max(1,Math.min(i,Math.round(o*r)));return{colSpan:c,rowSpan:Math.max(1,Math.round(a*(c/o)))}})}function a(e){if(!e||!e.getBoundingClientRect)return;const t=function(e){const t=[];for(let n=0;n0?Number(r):u,f=u+l,w=d+p,b=new Set,h=new Array(c);let m=0;const g=(e,t,n,i)=>{for(let o=0;o{((e,t,n,i)=>{for(let o=0;o1e4&&(h[t]={x:0,y:e,leftPx:0,topPx:e*w,widthPx:r*u+(r-1)*l,heightPx:a*d+(a-1)*p},b=!0)}}return{positions:h,containerHeight:m>0?m*w-p:0,unitPx:u}}(e,{columns:t,gapHorizontal:n,gapVertical:i,containerWidth:o,rowHeight:r})}(g,m,l,p,c,y);e.style.height=Math.ceil(v.containerHeight)+"px",e.style.visibility="visible";for(let e=0;efunction({slidesPerView:e,slidesPerGroup:t=1,bothDirections:n=!1,loopAdditionalSlides:i=0}){let o=Math.max(1,Math.ceil(Number(e)||1));const r=Math.max(1,Math.ceil(Number(t)||1));n&&o%2==0&&(o+=1);let a=n?Math.max(r,Math.ceil(o/2)):r;return a%r!==0&&(a+=r-a%r),o+a+Math.max(0,Math.ceil(Number(i)||0))}({slidesPerView:e,slidesPerGroup:t,bothDirections:k}))),C=!!t.loop&&Number(t.totalItems||0)>=L,q="rtl"===t.direction?"rtl":"ltr",O={loop:C,speed:Number(t.speed||500),effect:u,autoHeight:!!t.adaptiveHeight,direction:"horizontal",watchOverflow:!0,grabCursor:!0,noSwiping:!0,noSwipingSelector:".wpcp-audio-card__player",a11y:{scrollOnFocus:!1}};if(a&&(c.cubeEffect&&(O.cubeEffect=c.cubeEffect),c.coverflowEffect&&(O.coverflowEffect=c.coverflowEffect),c.centeredSlides&&(O.centeredSlides=c.centeredSlides)),"cube"===u&&(O.touchEventsTarget="container"),t.autoplay?O.autoplay={delay:Number(t.autoplayDelay||3e3),disableOnInteraction:!1,pauseOnMouseEnter:!!t.pauseOnHover,reverseDirection:"rtl"===q}:O.autoplay=!1,t.navigation){const t=e.querySelector(".wpcp-nav-prev"),n=e.querySelector(".wpcp-nav-next");t&&n&&(O.navigation={prevEl:t,nextEl:n})}let I=null;if(t.pagination){const n=e.querySelector(".wpcp-pagination");if(n){I=n;const e=(t.paginationOptions&&"object"==typeof t.paginationOptions?t.paginationOptions:{}).paginationStyle||"dots";switch(O.pagination={el:n,clickable:!0,type:"bullets"},e){case"stepper":O.pagination.bulletClass="swiper-pagination-bullet wpcp-pagination-bullet--stepper";break;case"dynamic":O.pagination.dynamicBullets=!0,O.pagination.dynamicMainBullets=1;break;default:O.pagination.type="bullets"}}}t.keyboard&&(O.keyboard={enabled:!0}),t.mousewheel&&(O.mousewheel=!0),t.freeMode&&(O.freeMode=!0),N||(O.centeredSlides=!!t.centeredSlides),r.setAttribute("dir","ltr"),O.breakpoints=N?{0:{slidesPerView:"auto",spaceBetween:x,slidesPerGroup:1},601:{slidesPerView:"auto",spaceBetween:v,slidesPerGroup:1},1025:{slidesPerView:"auto",spaceBetween:y,slidesPerGroup:1}}:{0:{slidesPerView:g,spaceBetween:x,slidesPerGroup:A},601:{slidesPerView:m,spaceBetween:v,slidesPerGroup:M},1025:{slidesPerView:h,spaceBetween:y,slidesPerGroup:S}},P&&O.breakpoints&&Object.keys(O.breakpoints).forEach(function(e){const t=O.breakpoints[e];t&&"object"==typeof t&&(t.slidesPerView=1,t.slidesPerGroup=1)}),e.dataset.wpcpSwiperInit="1";const j=new o(r,O);if("cube"===u&&function(e){e&&"1"!==e.dataset.wpcpCubeClicksInit&&(e.dataset.wpcpCubeClicksInit="1",e.addEventListener("click",function(t){if(t.defaultPrevented||0!==t.button)return;if(t.target.closest(".swiper-slide"))return;const n=e.querySelector(".swiper-slide-active");if(!n)return;const i=function(e,t,n){let i=null;const o=e=>{Array.prototype.forEach.call(e.children,function(e){if(!function(e){const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&"none"!==t.pointerEvents&&"0"!==t.opacity}(e))return;const r=e.getBoundingClientRect();r.width&&r.height&&(tr.right||nr.bottom||(i=e,o(e)))})};return o(e),i}(n,t.clientX,t.clientY);i&&(t.preventDefault(),i.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY})))}))}(r),j&&"function"==typeof j.changeLanguageDirection&&j.changeLanguageDirection("ltr"),function(e,t,n={}){if(!e||!t||"function"!=typeof e.on)return;const{forceHorizontalClass:i=!1}=n,o=function(){!function(e,t=!1){e&&(function(e,t){e&&!0===t&&(e.classList.remove("swiper-pagination-vertical"),e.classList.add("swiper-pagination-horizontal"))}(e,t),e.removeAttribute("style"),e.classList.contains("wpcp-pagination--dynamic")&&e.querySelectorAll(".swiper-pagination-bullet").forEach(function(e){e.removeAttribute("style")}))}(t,i)};o(),e.on("paginationUpdate",o),e.on("slideChange",o),e.on("slideChangeTransitionEnd",o),e.on("loopFix",o),e.on("resize",o),e.on("breakpoint",o),e.on("autoplay",o)}(j,I,{forceHorizontalClass:!1}),N&&j&&"function"==typeof j.update){const e=r.querySelectorAll(".swiper-slide img.wpcp-item-img");let t=0;const n=function(){window.requestAnimationFrame(function(){j.update()})};e.length?(e.forEach(function(e){if(e.complete&&0!==e.naturalWidth)return;t++;const i=function(){t--,t<=0&&n()};e.addEventListener("load",i,{once:!0}),e.addEventListener("error",i,{once:!0})}),0===t&&n()):n()}return!0}function d(e,t,...n){e&&"function"==typeof e[t]&&e[t](...n)}function f(e){if(e.dataset.wpcpInit)return;const t=function(e){try{const t=e.getAttribute("data-wpcp");return t?JSON.parse(t):{}}catch(e){return{}}}(e);if(function(e){if(!e||"1"===e.dataset.wpcpLightboxInit)return;const t=window.Fancybox;if(!t||"function"!=typeof t.bind||"object"!=typeof window.wpcp_lightbox||null===window.wpcp_lightbox||"object"!=typeof window.wpcp_lightbox.fancybox)return;e.dataset.wpcpLightboxInit="1";const n=e.getAttribute("id");if(!n)return;const i=`#${window.CSS&&CSS.escape?CSS.escape(n):n} [data-fancybox^="wpcp-"]`;t.bind(e,i,function(e={}){const t="object"==typeof window.wpcp_lightbox&&null!==window.wpcp_lightbox&&"object"==typeof window.wpcp_lightbox.fancybox?window.wpcp_lightbox.fancybox:{},n=e.on||{},{on:i,...o}=e;return{...t,...o,on:{...t.on||{},...n,ready:e=>{const i=e?.getContainer?.()||e?.getSlide?.()?.$container;if(i){i.classList.add("wpcp-lightbox-wrapper");const e=t.theme||"";e&&"auto"!==e&&i.setAttribute("theme","light"===e?"light":"dark")}d(t.on,"ready",e),d(n,"ready",e)}}}}()),e.addEventListener("click",t=>{const n=t.target.closest(".wpcp-lightbox-icon[data-wpcp-lb-proxy]");if(!n||!e.contains(n))return;const i=n.closest(".wpcp-item-media")||n.closest(".wpcp-item"),o=i&&i.querySelector('a[data-fancybox^="wpcp-"]');o&&(t.preventDefault(),o.click())})}(e),n(t))return void(e.dataset.wpcpInit="tiles");const i=(t,n)=>{t(),e.dataset.wpcpInit=e.dataset.wpcpSwiperInit?n:"idle"};"thumbnails"!==(t.style||"standard")?i(()=>u(e,t),"swiper"):i(()=>function(e,t){if(!e||"1"===e.dataset.wpcpThumbnailsInit)return;const n=window.Swiper;if("function"!=typeof n)return;const i=e.querySelector(".wpcp-thumbs-main.swiper"),o=e.querySelector(".wpcp-thumbs-strip.swiper");if(!i||!o)return;const r=e.querySelector(".wpcp-thumbs-area"),a=t.thumbnailsSlider&&"object"==typeof t.thumbnailsSlider?t.thumbnailsSlider:{},c=a.thumbsPerView||{},s=a.thumbGap||{},l="rtl"===t.direction?"rtl":"ltr",p=!!t.loop&&Number(t.totalItems||0)>1,u=new n(o,{direction:"horizontal",slidesPerView:Math.max(1,Number(c.mobile??3)),spaceBetween:Number(s.mobile??s.desktop??24),centeredSlides:!1,watchSlidesProgress:!0,slideToClickedSlide:!0,freeMode:!0,observer:!0,observeParents:!0,grabCursor:!0,loop:p,breakpoints:{601:{slidesPerView:Math.max(1,Number(c.tablet??4)),spaceBetween:Number(s.tablet??s.desktop??24)},1025:{slidesPerView:Math.max(1,Number(c.desktop??5)),spaceBetween:Number(s.desktop??24)}}}),d=t.effect||"slide",f={slidesPerView:1,spaceBetween:0,speed:Number(t.speed||500),loop:!!t.loop&&Number(t.totalItems||0)>1,effect:d,autoHeight:!0,grabCursor:!0,watchOverflow:!0,thumbs:{swiper:u}};if("fade"===d&&(f.fadeEffect={crossFade:!0}),t.autoplay&&(f.autoplay={delay:Number(t.autoplayDelay||3e3),disableOnInteraction:!1,pauseOnMouseEnter:!!t.pauseOnHover,reverseDirection:"rtl"===l}),t.keyboard&&(f.keyboard={enabled:!0}),t.mousewheel&&(f.mousewheel=!0),t.navigation){const t=e.querySelector(".wpcp-nav-prev"),n=e.querySelector(".wpcp-nav-next");t&&n&&(f.navigation={prevEl:t,nextEl:n})}r&&r.classList.remove("wpcp-thumbs-area--no-js");const w=new n(i,f),b=function(){const e="number"==typeof w.realIndex?w.realIndex:w.activeIndex;o.querySelectorAll(".swiper-slide.wpcp-thumb").forEach(function(t,n){n===e?t.classList.add("wpcp-thumb-active"):t.classList.remove("wpcp-thumb-active")})};"function"==typeof w.on&&(w.on("slideChange",b),w.on("init",b)),b(),e.dataset.wpcpSwiperInit="1",e.dataset.wpcpThumbnailsInit="1",w&&"function"==typeof w.changeLanguageDirection&&w.changeLanguageDirection("ltr")}(e,t),"swiper")}function w(){document.querySelectorAll(".wpcp-block[data-wpcp]").forEach(function(e){try{f(e)}catch(t){e.dataset.wpcpInit="error",console.error("[wp-carousel-free] block init failed",e,t)}})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",w):w(),window.WPCarouselFree=window.WPCarouselFree||{},window.WPCarouselFree.initialize=function(){w()},window.wpcpSocialShareBound||(window.wpcpSocialShareBound=!0,document.addEventListener("click",async n=>{const i=n.target;if(!i||"function"!=typeof i.closest)return;const o=i.closest('.wpcp-copy-btn[data-action="copy"]');if(!o)return;n.preventDefault();const r=o.dataset.url||"";r&&await async function(e){if(navigator.clipboard&&navigator.clipboard.writeText)try{return await navigator.clipboard.writeText(e),!0}catch(e){}try{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.select();const n=document.execCommand("copy");return document.body.removeChild(t),n}catch(e){return!1}}(r),function(n){if(!(n instanceof Element))return;const i=n.querySelector(".wpcp-post-url-copy-popup");i&&(i.classList.remove(e),clearTimeout(t.get(i)),t.set(i,setTimeout(()=>{i.classList.add(e),t.delete(i)},1500)))}(o)})),function(){var e;function t(){document.dispatchEvent(new Event("wpcp:tiles:relayout"))}function n(e,t){e.classList.toggle("is-loading",!!t)}function i(e,i,o){let r=0,a=0;function c(e){const t=String(e);i.querySelectorAll(".wpcp-ajax-pagination__btn").forEach(function(e){e.classList.toggle("is-active",e.getAttribute("data-wpcp-page")===t)})}function s(s){const l=function(e){return e.querySelector(".wpcp-tiles-grid")}(e);if(!l)return;r+=1;const p=r;a=p;const u=l.innerHTML,d=Number(i.getAttribute("data-wpcp-pagination-current"))||1;n(i,!0),function(e){if(e.querySelector(".wpcp-ajax-pagination__spinner"))return;const t=document.createElement("span");t.className="wpcp-ajax-pagination__spinner wpcp-preloader-spinner",t.setAttribute("aria-hidden","true"),e.appendChild(t)}(i),c(s),function(e,t){const n=window.wpcpBlocksAjax||null;return n&&n.restUrl?fetch(n.restUrl,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":n.nonce||""},body:JSON.stringify({...e,page:t})}).then(function(e){return e.ok?e.json():Promise.reject(new Error("wpcp: REST status "+e.status))}):Promise.reject(new Error("wpcp: missing AJAX config"))}(o,s).then(function(n){if(p!==a)return;"string"==typeof n.html&&(l.innerHTML=n.html);const r=Number(n.total_pages)||1,u=Math.min(Math.max(1,s),r);"string"==typeof n.controlsHtml?function(e,t,n,i){if(e){if(e.classList.toggle("is-empty",n<=1),Array.prototype.filter.call(e.children,function(e){return e.classList.contains("wpcp-ajax-pagination__btn")}).forEach(function(e){e.parentNode.removeChild(e)}),"string"==typeof t&&t.length){const n=document.createRange().createContextualFragment(t);e.appendChild(n)}e.setAttribute("data-wpcp-pages-total",String(Math.max(1,n))),e.setAttribute("data-wpcp-pagination-current",String(Math.max(1,i)))}}(i,n.controlsHtml,r,u):(i.setAttribute("data-wpcp-pagination-current",String(u)),c(u)),l.dispatchEvent(new CustomEvent("wpcp:tiles:swapped",{bubbles:!0})),requestAnimationFrame(t),function(e,t){const n=t.paginationOptions||{};if(!n.scrollToTop)return;const i=Number(n.scrollOffset||0),o=e.getBoundingClientRect(),r=(window.pageYOffset||document.documentElement.scrollTop||0)+o.top-i;window.scrollTo({top:r,behavior:"smooth"})}(e,o)}).catch(function(e){p===a&&(l.innerHTML=u,c(d),console.error(e))}).then(function(){p===a&&n(i,!1)})}i.addEventListener("click",function(e){const t=e.target.closest(".wpcp-ajax-pagination__btn");if(!t||t.classList.contains("is-ellipsis")||t.disabled)return;const n=t.getAttribute("data-wpcp-page");if(!n)return;const o=Number(i.getAttribute("data-wpcp-pagination-current"))||1,r=Number(i.getAttribute("data-wpcp-pages-total"))||1;let a=o;a="prev"===n?Math.max(1,o-1):"next"===n?Math.min(r,o+1):parseInt(n,10),Number.isFinite(a)&&a!==o&&s(a)})}function o(e,t){if("1"===t.getAttribute("data-wpcp-pagination-bound"))return;t.setAttribute("data-wpcp-pagination-bound","1");const n=function(e,t="wpcp: invalid pagination payload"){if(!e)return null;const n=e.getAttribute("data-wpcp-pagination");if(!n)return null;try{return JSON.parse(n)}catch(e){return console.error(t,e),null}}(t);n&&t.classList.contains("wpcp-ajax-pagination--number")&&i(e,t,n)}"undefined"!=typeof window&&"undefined"!=typeof document&&(e=function(){const e=document.querySelectorAll(".wpcp-block-tiles");for(let t=0;t